package com.xbongbong.admin.model.impl;

import com.xbongbong.admin.domain.dao.MirrorStageProcessDao;
import com.xbongbong.admin.domain.entity.MirrorStageProcessEntity;
import com.xbongbong.admin.model.MirrorStageProcessModel;
import com.xbongbong.paas.toolbox.util.DateUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author bomfish
 */
@Service("mirrorStageProcessModel")
public class MirrorStageProcessModelImpl implements MirrorStageProcessModel {
    @Resource
    private MirrorStageProcessDao mirrorStageProcessDao;

    @Override
    public Integer insert(MirrorStageProcessEntity entity) {
        Long time = DateUtil.getNow();
        entity.setAddTime(time);
        entity.setUpdateTime(time);
        return mirrorStageProcessDao.insert(entity);
    }

    @Override
    public void insertBatch(List<MirrorStageProcessEntity> list) {
        mirrorStageProcessDao.insertBatch(list);
    }

    @Override
    public List<MirrorStageProcessEntity> findEntitys(Map<String, Object> param) {
        return mirrorStageProcessDao.findEntitys(param);
    }

    @Override
    public Integer getEntitysCount(Map<String, Object> param) {
        return mirrorStageProcessDao.getEntitysCount(param);
    }

    @Override
    public Integer update(MirrorStageProcessEntity entity) {
        Long time = DateUtil.getNow();
        entity.setUpdateTime(time);
        return mirrorStageProcessDao.update(entity);
    }

    @Override
    public MirrorStageProcessEntity getByKey(Long key, String corpid) {
        return mirrorStageProcessDao.getByKey(key, corpid);
    }

    @Override
    public List findEntitysWithoutSub(Map<String, Object> param) {
        return mirrorStageProcessDao.findEntitys(param);
    }
}
